package com.itheima.homework.assignment.Test02;

import java.util.ArrayList;

/**
 * 表格中是三年级一班的学生信息,后来张三丰移民到了山东,李老师需要将张三丰对应的住址改掉,请用程序完成需求,并将学生的信息打印到控制台上
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student(1,"张无忌","河北"));
        students.add(new Student(2, "张三丰", "河南"));
        students.add(new Student(3, "赵敏", "蒙古"));
        students.add(new Student(4, "周芷若", "四川"));

        for (int i = 0; i < students.size(); i++) {
            if (students.get(i).getName().equals("张三丰")) {
                students.get(i).setAddress("山东");
            }
        }

        students.forEach(System.out::println);
    }
}
